<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title>签约管理</title>
		<link rel="stylesheet" href="__AGENT__/css/iconfont.css" />
		<link rel="stylesheet" href="__AGENT__/css/qianyue.css" />
		<link rel="stylesheet" href="__AGENT__/css/css.css" />
	</head>

	<body>
		{include file="public/header" /}
		<div class="index_conbox">
			<div class="index_content clearfix">
				{include file="public/lefter" /}
				<div class="right">
					<div class="rigtop">
						<span class="title"><a href="#">签约管理</a><em>》去签约</em></span>
					</div>
					<div class="indrig_con qianyue_con">
						<div class="qiany_steps">
							<!--签约步骤-->
							<div class="qiany_steps_item qiany_steps-status-wait" style="margin-right: -24px; width: 25%;">
								<div class="qiany_steps_line" style="padding-right: 24px;"><i></i></div>
								<div class="qiany_steps_step">
									<div class="qiany_steps_head">
										<div class="qiany_steps_head_inner"><span class="qiany_steps_icon">1</span></div>
									</div>
									<div class="qiany_steps_main">
										<div class="qiany_steps_title">签约基本信息</div>
									</div>
								</div>
							</div>
							<div class="qiany_steps_item qiany_steps_choice" style="margin-right: -24px; width: 25%;">
								<div class="qiany_steps_line" style="padding-right: 24px;"><i></i></div>
								<div class="qiany_steps_step">
									<div class="qiany_steps_head">
										<div class="qiany_steps_head_inner"><span class="qiany_steps_icon">2</span></div>
									</div>
									<div class="qiany_steps_main">
										<div class="qiany_steps_title">商户注册信息</div>
									</div>
								</div>
							</div>
							<div class="qiany_steps_item qiany_steps-status-wait" style="margin-right: -24px; width: 25%;">
								<div class="qiany_steps_line" style="padding-right: 24px;"><i></i></div>
								<div class="qiany_steps_step">
									<div class="qiany_steps_head">
										<div class="qiany_steps_head_inner"><span class="qiany_steps_icon">3</span></div>
									</div>
									<div class="qiany_steps_main">
										<div class="qiany_steps_title">结算资金账号</div>
									</div>
								</div>
							</div>
							<div class="qiany_steps_item qiany_steps-status-wait" style="margin-right: -24px; width: 25%;">
								<div class="qiany_steps_line" style="padding-right: 24px;"><i></i></div>
								<div class="qiany_steps_step">
									<div class="qiany_steps_head">
										<div class="qiany_steps_head_inner"><span class="qiany_steps_icon">4</span></div>
									</div>
									<div class="qiany_steps_main">
										<div class="qiany_steps_title">上传附件</div>
									</div>
								</div>
							</div>
							<div class="qiany_steps_item qiany_steps-status-wait">
								<div class="qiany_steps_line" style="padding-right: 0px;"><i></i></div>
								<div class="qiany_steps_step">
									<div class="qiany_steps_head">
										<div class="qiany_steps_head_inner"><span class="qiany_steps_icon">5</span></div>
									</div>
									<div class="qiany_steps_main">
										<div class="qiany_steps_title">提交签约</div>
									</div>
								</div>
							</div>
						</div>
						<!--签约步骤-->
						<form class="mui-input-group gerenzl_group layui-form">
							{if $data['agent_type'] != 2  }
							<div class="shxx_item">
								<div class="shxx_title">注册信息（营业执照）</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>注册名称</div>
									<div class="right">
										<div class="htrig_box">
											<div class="htrig_con">
												<input type="text" name="regist_name" value="{$data.regist_name}" class="chax_input" placeholder="注册名称为必填项" lay-verify="required" autocomplete="off" class="layui-input">
											</div>
											<p class="redtip">注册名称为必填项</p>
										</div>
									</div>
								</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>注册地址</div>
									<div class="right">
										<div class="htrig_box">
											<div class="htrig_con">
												<input type="text" name="regist_address" value="{$data.regist_address}" class="chax_input" placeholder="注册地址为必填项" lay-verify="required" autocomplete="off" class="layui-input">
											</div>
											<p class="redtip">注册地址为必填项</p>
										</div>
									</div>
								</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>营业执照编号</div>
									<div class="right">
										<div class="htrig_box">
											<div class="htrig_con">
												<input type="text" name="license" value="{$data.license}" class="chax_input" placeholder="营业执照编号为必填项" lay-verify="required" autocomplete="off" class="layui-input">
											</div>
											<p class="redtip">营业执照编号为必填项</p>
										</div>
									</div>
								</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>主营业务</div>
									<div class="right">
										<div class="htrig_box">
											<div class="htrig_con">
												<textarea class="qiany_textarea"  placeholder="主营业务为必填项" name="main_business">{$data.main_business}</textarea>
											</div>
											<p class="redtip">主营业务为必填项</p>
										</div>
									</div>
								</div>
								<div class="shxx_row qiany_row clearfix">
									<div class="left"><em>*</em>营业期限</div>
									<div class="right clearfix">
										<div class="htrig_box">
											<div class="htrig_con">
												<input type="text" name="business_time1" value="{$data.business_time1|substr=0,10}" id="date" lay-verify="date" placeholder="开始时间" autocomplete="off" class="layui-input">
												<i class="chax_line"></i>
												<input type="text" name="business_time2" value="{$data.business_time2|substr=0,10}" id="date1" lay-verify="date1" placeholder="结束时间" class="layui-input">
											</div>
										</div>
										<p class="wztip">结束时间不填, 则为长期有效</p>
									</div>
								</div>
							</div>
							{/if}
							<div class="shxx_item">
								<div class="shxx_title">法人信息</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>法人姓名</div>
									<div class="right">
										<div class="htrig_box">
											<div class="htrig_con">
												<input type="text" name="legal_name" value="{$data.legal_name}" class="chax_input" placeholder="法人姓名为必填项" lay-verify="required" autocomplete="off" class="layui-input">
											</div>
											<p class="redtip">法人姓名为必填项</p>
										</div>
									</div>
								</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>证件类型</div>
									<div class="right">
										<div class="htrig_box">
											<div class="htrig_con">
												<input type="text" name="document_type" value="{$data.document_type}" class="chax_input" placeholder="证件类型为必填项" lay-verify="required" autocomplete="off" class="layui-input">
											</div>
											<p class="redtip">证件类型为必填项</p>
										</div>
									</div>
								</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>法人证件编号</div>
									<div class="right">
										<div class="htrig_box">
											<div class="htrig_con">
												<input type="text" name="document_no" value="{$data.document_no}" class="chax_input" placeholder="法人证件编号为必填项" lay-verify="required" autocomplete="off" class="layui-input">
											</div>
											<p class="redtip">法人证件编号为必填项</p>
										</div>
									</div>
								</div>
								<div class="shxx_row qiany_row clearfix">
									<div class="left"><em>*</em>有效期</div>
									<div class="right clearfix">
										<div class="htrig_box">
											<div class="htrig_con">
												<input type="text" name="document_time1" value="{$data.document_time1|substr=0,10}" id="date2" lay-verify="date" placeholder="开始时间" autocomplete="off" class="layui-input">
												<i class="chax_line"></i>
												<input type="text" name="document_time2" value="{$data.document_time2|substr=0,10}" id="date3" lay-verify="date1" placeholder="结束时间" class="layui-input">
											</div>
										</div>
										<p class="wztip">结束时间不填, 则为长期有效</p>
									</div>
								</div>
							</div>
						<div class="qiany_bzbtnbox">
							<button type="button" class="qiany_bzbtn" lay-submit lay-filter="submit_from"><span>保存并下一步</span></button>
							<button type="button" class="qiany_bzbtn defult fanhui"><span>上一步</span></button>
						</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		{include file="public/footer" /}
	</body>

</html>
<script>
layui.use(['form', 'layedit', 'laydate'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate;
  
  //监听表单提交
		form.on('submit(submit_from)', function(data){
			tijiao();
  			return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
		});
  
  //日期
  laydate.render({
    elem: '#date'
  });
  laydate.render({
    elem: '#date1'
  });
  laydate.render({
    elem: '#date2'
  });
  laydate.render({
    elem: '#date3'
  });	
  
  
});

//返 回
$('.fanhui').click(function() {
	location.href = "{:url('index/qianyue_step1')}";
})
//提交表单
function tijiao(){
	 $.ajax({
         	type:"post",
            url:"{:url('index/qianyue_step2')}",
            data: $('.layui-form').serialize(),//表单数据
            success:function(data){
                if(data.code==200){
                	layer.msg('成功', {
					  icon: 1,
					  time: 1500 //2秒关闭（如果不配置，默认是3秒）
					}, function(){
						location.href = "{:url('index/qianyue_step3')}";
					});
                }else{
                	layer.msg('失败！');//保存成功提示
                }
            },error:function(data){
            	var a = data;
            }
    });
	
}
</script>